<?php

// ejemplo de autenticación
$ldaprdn  = 'FCE\tecnologiab';     // ldap rdn or dn
$ldappass = '1234abcd';  // associated password

// conexión al servidor LDAP
$ldapconn = ldap_connect("172.19.10.10")
    or die("Could not connect to LDAP server.");

if ($ldapconn) {

    // realizando la autenticación
    $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);

    // verificación del enlace
    if ($ldapbind) {
        echo "LDAP bind successful...";
    } else {
        echo "LDAP bind failed...";
    }

}

$attributes_ad = array("displayName","description","cn","givenName","sn","mail","co","mobile","company","displayName");
// define base
$base ="";
$email = "tecno";


$result = ldap_search($ldapconn, "dc=FCE", "(givenName=H*)") or die ("Error in query");